package vashion.azeroth.core.personal.tran.pojo;

import java.math.BigDecimal;
import java.util.Date;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;

import vashion.azeroth.common.date.DateUtil;
import vashion.azeroth.common.math.BigDecimalUtil;
import vashion.azeroth.core.pojo.BaseObject;

public class PersonalTranDetail extends BaseObject {

	private static final long serialVersionUID = -1704149267908775742L;

	private String tranNo;

    private Long memberId;

    private String memberName;

    private long income;

    private long payout;

    @JsonIgnore
    private long preBalance;

    @JsonIgnore
    private long curBalance;

    private Integer tranType;

    private Date timeAdd;

    @JsonIgnore
    private String userAdd;

    private String remark;
    
    private String timeType;
    
    public String getPreBalanceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(preBalance), new BigDecimal(100)).toString();
    }
    
    public String getCurBalanceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(curBalance), new BigDecimal(100)).toString();
    }
    
	public String getTimeAddStr() {
		try {
			return DateUtil.dateFormat(DateUtil.ymdhms_DATE_FORMAT, DateUtil.ymdhmsFormat(timeAdd));
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			e.printStackTrace();
		}
		return "";
	}
	
    public String getTranNo() {
        return tranNo;
    }

    public void setTranNo(String tranNo) {
        this.tranNo = tranNo;
    }

    public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}

	public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public long getIncome() {
		return income;
	}

	public void setIncome(long income) {
		this.income = income;
	}

	public long getPayout() {
		return payout;
	}

	public void setPayout(long payout) {
		this.payout = payout;
	}

	public long getPreBalance() {
		return preBalance;
	}

	public void setPreBalance(long preBalance) {
		this.preBalance = preBalance;
	}

	public long getCurBalance() {
		return curBalance;
	}

	public void setCurBalance(long curBalance) {
		this.curBalance = curBalance;
	}

	public Integer getTranType() {
		return tranType;
	}

	public void setTranType(Integer tranType) {
		this.tranType = tranType;
	}

	public Date getTimeAdd() {
        return timeAdd;
    }

    public void setTimeAdd(Date timeAdd) {
        this.timeAdd = timeAdd;
    }

    public String getUserAdd() {
        return userAdd;
    }

    public void setUserAdd(String userAdd) {
        this.userAdd = userAdd;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

	public String getTimeType() {
		return timeType;
	}

	public void setTimeType(String timeType) {
		this.timeType = timeType;
	}
    
}